<html>
<head>
<script src="../../resources/js-test.js"></script>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

var iframeHasLoadedFirstPage = false;

function runTest()
{
    shouldBe("document.getElementById('theFrame').contentDocument.baseURI", "document.baseURI");
    var frameDoc = document.getElementById('theFrame').contentWindow.document;
    var innerFrame = frameDoc.createElement("iframe");
    innerFrame.src = "resources/iframe-no-src-set-location-pass.html";
    innerFrame.id = "innerFrame";
    innerFrame.onload = function() {
        shouldBe("document.getElementById('theFrame').contentDocument.getElementById('innerFrame').contentDocument.body.innerHTML", "'PASS\\n'");
        isSuccessfullyParsed();
        if (window.testRunner)
            testRunner.notifyDone();
    }
    frameDoc.body.appendChild(innerFrame);
}

</script>
</head>
<body>
<script>
description("This tests that an iframe with no src attribute uses the parent document's origin when resolving links inserted into the frame via JavaScript.");
</script>
<iframe id="theFrame" onload="runTest()"></iframe>
</body>
</html>
